Skip to content

feat(mobile): bring GitLab and Bitbucket pull request review to GitHub parity (stack 5/30) - #6007

Closed
iscekic wants to merge 5 commits into
kwf/bring-mobile-gitlab-and-bitb-3792-l4from
kwf/bring-mobile-gitlab-and-bitb-3792-l5
Closed

feat(mobile): bring GitLab and Bitbucket pull request review to GitHub parity (stack 5/30)#6007
iscekic wants to merge 5 commits into
kwf/bring-mobile-gitlab-and-bitb-3792-l4from
kwf/bring-mobile-gitlab-and-bitb-3792-l5

Conversation

@iscekic

@iscekic iscekic commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Not verified. kwf reopened this section on 2026-09-09: publication failed: level 2: pr-api: HTTP/2.0 422 Unprocessable Entity
pr-api: date: Wed, 09 Sep 2026 17:39:45 GMT
pr-api: x-ratelimit-limit: 5000
pr-api: x-ratelimit-remaining: 4901
pr-api: x-ratelimit-used: 99
pr-api: x-ratelimit-reset: 1788978098
pr-api: x-ratelimit-resource: core
pr-api: x-githu
The proof below came from an earlier round and can be stale. Do not review until this note is gone.

Level 5 of the bring-mobile-gitlab-and-bitb-3792 stack.

  • chore: translate the new catalog keys into every locale (kwf bring-mobile-gitlab-and-bitb-3792/s-i18n)
  • chore: translate the new provider-review catalogs (kwf bring-mobile-gitlab-and-bitb-3792/s9)
  • chore: entry points: pasted/shared URLs (any provider, self-managed hosts), recents identity, session-linked badge, deep links, connect gate (kwf bring-mobile-gitlab-and-bitb-3792/s7)
  • fix: fix reviewer blocking findings from s6 (kwf bring-mobile-gitlab-and-bitb-3792/s6f)
  • chore: one mobile presentation: provider-aware PR review read surface (inbox, detail, files, diffs, discussions, checks) (kwf bring-mobile-gitlab-and-bitb-3792/s5)

PR stack (merge bottom to top)

… (inbox, detail, files, diffs, discussions, checks) (kwf bring-mobile-gitlab-and-bitb-3792/s5)
…osts), recents identity, session-linked badge, deep links, connect gate (kwf bring-mobile-gitlab-and-bitb-3792/s7)
This was referenced Sep 9, 2026
@iscekic
iscekic marked this pull request as draft September 9, 2026 17:31
*/
const GITLAB_ACTIVE_PIPELINE_STATUSES = new Set([
'created',
'waiting_for_resources',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: GitLab pipeline status typo will refuse auto-merge while waiting for a runner

GitLab's API uses waiting_for_resource (singular). This set has waiting_for_resources, plus non-existent waiting and completing. An MR whose latest pipeline is waiting_for_resource fails hasActivePipeline and is rejected with GITLAB_AUTO_MERGE_NO_PIPELINE_REASON instead of arming merge-when-pipeline-succeeds.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

const gitlabStatus = useGitLabStatus(scope);
const bitbucketReadiness = useBitbucketReadiness(scope);

const github = usePrInbox(enabled);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: GitHub inbox is always queried, unlike GitLab/Bitbucket

usePrInbox(enabled) runs whenever the merged inbox is on, while GitLab/Bitbucket are gated on connected === true. githubPrReview.listInbox goes through withGitHubUserTokenRetry and fails when GitHub is not connected. A GitLab-only user then either gets a GitHub reconnect empty state (inbox has no provider scope, so PrReviewReconnectNotice falls back to GitHub) or a working GitLab list plus an unrecoverable "couldn't load more" retry.

Gate GitHub the same way as the other providers (useGitHubStatus).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

};
}
return {
threadsPath: trpc.providerReview.listDiscussions.pathFilter(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Provider resolve optimistic updates apply across every cached discussion list

listDiscussions.pathFilter() matches every provider discussion query, and applyProviderResolveToggle matches only threadId. GitLab discussion ids are unique hashes; Bitbucket uses String(root.id), a per-PR integer. Resolving thread "1" on PR A flips every cached Bitbucket PR that also has thread "1". The shared generationKey and chainSave key pr-thread:${platform}:${threadId} (no PR identity) also let a later resolve on PR B suppress PR A's rollback.

Scope the path filter (or the toggle) to the current PR identity.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@@ -149,6 +175,8 @@ export function DiscussionThread({
<CommentRow

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: GitHub moderation overflow still mounts on GitLab and Bitbucket comments

Reactions are gated (readOnly={!isGithub}, reactionsSupported), but CommentRow always shows the overflow menu and calls moderation.blockUser / muteUser with { githubLogin: author.login } and reportContent with the provider comment id. GitLab/Bitbucket logins are not GitHub identities; a colliding login blocks or mutes the wrong GitHub user.

Hide the overflow (or the GitHub-only actions) when !isGithub.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

const isProviderArm = scope.ref.platform !== 'github';
const mergeStateSettled =
!isProviderArm || (!mergeStateQuery.isLoading && !mergeStateQuery.isPending);
const capabilitiesSettled = !needsAutoMergeCapability || !capabilitiesQuery.isPending;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Capabilities errors are treated as settled, so the sheet mounts without auto-merge capability

!capabilitiesQuery.isPending is true on error. The sheet then gets autoMergeCapability={undefined}, so autoMergeUnsupported stays false and Bitbucket's Enable Auto-merge form is shown. Confirm calls enableAutoMerge, which returns {supported:false, done:false} without throwing, and the sheet still celebrates, haptics, and dismisses as success. Retry also refetches only pr, not capabilities.

Treat isError as not settled (same as PrReviewReviewSubmitScreen requiring capabilitiesData !== undefined).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 5 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 5
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/lib/provider-review/gitlab-write.ts 100 Wrong GitLab pipeline status (waiting_for_resources) refuses auto-merge while waiting for a runner
apps/mobile/src/lib/pr-review/use-provider-inbox.ts 240 GitHub inbox is always queried; GitLab-only users hit reconnect or a stuck load-more error
apps/mobile/src/lib/pr-review/discussion/use-review-discussion-mutations.ts 154 Resolve optimistic updates match Bitbucket thread ids across every cached PR
apps/mobile/src/components/pr-review/discussion/discussion-thread.tsx 175 GitHub block/mute/report overflow still mounts on GitLab and Bitbucket comments
apps/mobile/src/components/pr-review/pr-review-merge-screen.tsx 150 Capabilities errors treated as settled; Bitbucket enable-auto-merge can celebrate a no-op
Files Reviewed (116 files)
  • apps/web/src/lib/provider-review/gitlab-write.ts - 1 issue
  • apps/mobile/src/lib/pr-review/use-provider-inbox.ts - 1 issue
  • apps/mobile/src/lib/pr-review/discussion/use-review-discussion-mutations.ts - 1 issue
  • apps/mobile/src/components/pr-review/discussion/discussion-thread.tsx - 1 issue
  • apps/mobile/src/components/pr-review/pr-review-merge-screen.tsx - 1 issue
  • apps/mobile/src/app/(app)/pr-review/[platform]/[...identity]/_layout.tsx
  • apps/mobile/src/app/(app)/pr-review/[platform]/[...identity]/index.tsx
  • apps/mobile/src/components/pr-review/pr-review-connect-gate.tsx
  • apps/mobile/src/components/pr-review/pr-review-entry-screen.tsx
  • apps/mobile/src/components/pr-review/pr-review-screen.tsx
  • apps/mobile/src/components/pr-review/pr-review-submit.tsx
  • apps/mobile/src/components/pr-review/merge/pr-merge-sheet.tsx
  • apps/mobile/src/components/pr-review/discussion/comment-row.tsx
  • apps/mobile/src/lib/pr-review/provider-pr-url.ts
  • apps/mobile/src/lib/pr-review/provider-pr-ref.ts
  • apps/mobile/src/lib/pr-review/provider-pr-queries.ts
  • apps/mobile/src/lib/pr-review/use-pr-review-mutations.ts
  • apps/mobile/src/lib/pr-review/merge/use-pr-merge-mutations.ts
  • services/git-token-service/src/index.ts
  • packages/app-shared/src/universal-links/routes.ts
  • packages/worker-utils/src/internal-service-token-audiences.ts
  • plus remaining mobile PR-review UI/lib files, tests, and locale catalog updates

Reviewed by grok-4.6 · Input: 301.1K · Output: 28.8K · Cached: 1.4M

Review guidance: REVIEW.md from base branch kwf/bring-mobile-gitlab-and-bitb-3792-l4

@iscekic iscekic closed this Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant